<?php
require 'sql.class.php';

// 添加数据()
if ($_GET["type"] == 0) {
	echo "这是添加数据";

	$username = $_POST["username"];
	$nickname = $_POST["nickname"];
	$password = $_POST["password"];
	$avatar = $_FILES["avatar"];
	$gender = $_POST["gender"];
	$mobile = $_POST["mobile"];

	addMemberInfo($username, $nickname, $password, $avatar, $gender, $mobile);
}

// 修改数据
if ($_GET["type"] == 1) {
	echo "开始修改数据";
	$id = $_POST["id"];
	$username = $_POST["username"];
	$nickname = $_POST["nickname"];
	$password = $_POST["password"];
	$avatar = $_POST["avatar"];
	$gender = $_POST["gender"];
	$mobile = $_POST["mobile"];

	editMemberInfo($id, $username, $nickname, $password, $avatar, $gender, $mobile);
}